package top.buluoluo.ordersservice.utils;

public class OrderCacheKeyUtil {
    // 生成用户订单分页缓存键
    public static String getUserOrderPageKey(Long userId, Integer pageNum, Integer pageSize) {
        return String.format("orders:user:%d:page:%d:size:%d", userId, pageNum, pageSize);
    }

    // 生成用户订单缓存前缀（用于清除所有相关缓存）
    public static String getUserOrderPrefix(Long userId) {
        return String.format("orders:user:%d:*", userId);
    }
}